#ifndef WORD_GAME_H
#define WORD_GAME_H

#include <QWidget>
#include "letter.h"

namespace Ui {
class word_game;
}

class word_game : public QWidget
{
    Q_OBJECT

public:
    explicit word_game(QWidget *parent = 0);
    ~word_game();

protected:
    void paintEvent(QPaintEvent *e);
    void timerEvent(QTimerEvent *e);
    void keyPressEvent(QKeyEvent *e);

    void mousePressEvent(QMouseEvent *e);
    void mouseReleaseEvent(QMouseEvent *e);
    void mouseMoveEvent(QMouseEvent *e);

private:
    Ui::word_game *ui;
    //Letter letters[10];
    QList<Letter*> listLetter;//容器，放Letter类对象的，这个容器中可以放很多

    int timerId;
    int x[10], y[10];
    char a[10];

    int score;

    int focusAppleID;
    bool isHit;

    int move_w;
    int move_h;
};

#endif // WORD_GAME_H
